package com.gardenguell.salad.ui.activity;

import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import com.gardenguell.salad.R;
import com.gardenguell.salad.ui.activity.base.ToolbarActivity;
import com.gardenguell.salad.ui.fragment.MainFragment;
import com.gardenguell.salad.ui.fragment.VegetableFragment;
import com.gardenguell.salad.util.ResUtil;

public class VegetableActivity extends ToolbarActivity {

    private FragmentManager mFragmentManager = getSupportFragmentManager();

    public String mac;
    public int unitId;

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_vegetable;
    }


    @Override
    public boolean canBack() {
        return true;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if(getIntent() != null){
            Bundle bundle = getIntent().getExtras();
            if(bundle != null){
                mac = bundle.getString("mac");
                unitId = bundle.getInt("unitId");
            }
        }
        setToolbarTitle(ResUtil.getString(R.string.vegetable_library));
        mFragmentManager.beginTransaction()
                .add(R.id.content_fragment, new VegetableFragment())
                .commit();
    }



}
